Option Strict Off
Option Explicit On
Module conexion_bd
	Public Function conexion() As Object
		'CONEXION AL MANEJADOR DE BASE DE DATOS MYSQL
		conn = New ADODB.Connection
		conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & "SERVER=127.0.0.1;" & "DATABASE=aguas;" & "UID=root;" & "PWD=;" & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
		conn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
		
		conn.Open() 'Se inicia la conexion
	End Function
	Public Function finsert_Ado(ByRef vpsSql As String, ByRef conn As ADODB.Connection) As Boolean
		Dim vpl_Reg_Cmd As ADODB.Command
		'Dim conn As ADODB.Connection
		On Error GoTo Error1
		vpl_Reg_Cmd = New ADODB.Command
		vpl_Reg_Cmd.let_ActiveConnection(conn)
		vpl_Reg_Cmd.CommandText = vpsSql
		vpl_Reg_Cmd.Execute()
		finsert_Ado = True
		Exit Function
Error1: 
		finsert_Ado = False
	End Function
End Module